-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Add ElastixFilter.UpdateInParallel GoogleTest unit test #393
base: main
Are you sure you want to change the base?
Conversation
0e0fd13
to
491cafa
Compare
Hi Konstantinos (@ntatsisk), as you see, I did try to make some progress 😃 You may have a look! However, I still get those messages, when running the
I don't really like them. The following example code also produces such messages:
So it really means that the spawned threads are trying to change the number of threads! I don't think that's OK! (Update: it appears to happen here: https://github.com/SuperElastix/elastix/blob/5.0.1/Common/CostFunctions/itkAdvancedImageToImageMetric.hxx#L96 ) Moreover,
Do you see the same? Do you have a clue where those numbers like Note: In order to run this test, which is part of ElastixLibGTest, you may need to enable GoogleTest unit testing, by elastix CMake flag |
For the record, the
|
@ntatsisk It appears essential, when you have an OpenMP for-loop in your "client code", calling ElastixFilter.Update in parallel, you should have built Elastix with Does that solve your issue? PS As you can see, I tried adding mutex locking to the |
Hi @N-Dekker, I did a quick test with the branch using |
Update: when you do |
I made a pull request that seems to work: #406. I tested it on my application and it runs with no issues but I haven't tried the gtests. Bonus: it even works with |
491cafa
to
89a697a
Compare
I think maybe the
|
Hi @N-Dekker, that could be an option. However, I also see that currently, all the Line 215 in b65034e
Line 588 in b65034e
Is there a plan to re-introduce OpenMP or is it going to be deprecated/removed completely soon? |
Originally based on a code snippet by Konstantinos Ntatsis at pull request #389 ("ENH: Make ElastixMain database creation + loading components thread safe"): #389 (comment)
89a697a
to
e272873
Compare
Originally based on a code snippet by Konstantinos Ntatsis (@ntatsisk) at pull request #389 ("ENH: Make ElastixMain database creation + loading components thread safe"):
#389 (comment)
This unit test is expected to pass successfully only when the elastix component database is indeed thread-safe.